package com.zyj.utils.d3.base;

        import com.zyj.utils.d3.entity.Point;
        import com.zyj.utils.maths.MathUtils;

public class PointUtils {
    /**
     * 判断两个坐标点是否重合
     *
     * @param A
     * @param B
     * @return
     */
    public static boolean towPointsIsSame(Point A, Point B) {
        double AB = calculatePointsDist(B, A);
        return MathUtils.isZero(AB);
    }

    /**
     * 计算线段AB的距离
     * @param A
     * @param B
     * @return
     */
    public static double calculatePointsDist(Point A, Point B) {
        return Math.sqrt(Math.pow(A.x - B.x, 2) + Math.pow(A.y - B.y, 2) + Math.pow(A.z - B.z, 2));
    }
}